/*
 * Copyright (c) 2022  by Junzhao
 * THIS FILE IS PART OF JAVASE Song Huongkang PROJECT
 * All Rights Reserved.
 */

import java.util.Scanner;

class show {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        System.out.print("数组元素个数：");
        int a = sc.nextInt();
        int[] arr=new int[a];

        for(int i=0;i<arr.length;i++){
            System.out.print("您现在输入的是第"+(i+1)+"个元素");
            if(sc.hasNextInt()){
                arr[i]= sc.nextInt();
            }else{
                sc.next();
                System.out.print("只可以输入数字！");
                i--;
            }
        }
        printArr(arr);
        System.out.println("这个数组的最大值为"+evenSum(arr));

    }
    public static void printArr(int[] arr){
        for (int a:arr){
            System.out.print(a+" ");
        }
        System.out.println();
    }
    //偶数和
    public static int evenSum(int[] arr){
        int sum = 0;
        for (int j : arr) {
            if (j % 2 == 0) {
                sum += j;
            }
        }
        return sum;
    }
    //最值

//let us try one time!
//bingo!
}
